<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>TODO supply a title</title>
    </head>
    <body>
        <div>
            <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                            xmlns:ui="http://java.sun.com/jsf/facelets"
                            xmlns:h="http://java.sun.com/jsf/html"
                            xmlns:rich="http://richfaces.org/rich"
                            xmlns:a4j="http://richfaces.org/a4j"
                            xmlns:fn="http://java.sun.com/jsp/jstl/functions"
                            xmlns:f="http://java.sun.com/jsf/core">
                <style type="text/css">
                    .demo_fieldset {
                        margin : 20px;
                        border : 1px solid #ACBECE;
                    }

                    .demo_legend {
                        font-weight : bold;
                        margin : 0px 10px 0px 18px;
                        font-family: Verdana;
                    }
                </style>

                <h:form id="emp">
                    <rich:panel header="预算审核" styleClass="content-hight">
                        <h:panelGrid id="numberPer" columns="10" style="margin:-10px 0px 0px 0px;">
                            第<h:outputText value="#{budgetCheckGovBean.curIndex+1}" style="color:red"/>条，
                            共<h:outputText value="#{budgetCheckGovBean.linkedli.size()}" style="color:red;"/>条；
                            <h:outputLabel id="err" value="#{queryBean.err.errtip}" style="color:red"/>
                        </h:panelGrid>
                        <rich:toolbar id="tolbar">
                            <rich:toolbarGroup>
                                <a4j:commandButton value="首张" action="#{budgetCheckGovBean.first}"  render="editGrid,checkGroup,err,numberPer,canclButton"/>
                                <a4j:commandButton value="上一张" action="#{budgetCheckGovBean.previou}"  render="editGrid,checkGroup,err,numberPer,canclButton"/>
                                <a4j:commandButton value="下一张" action="#{budgetCheckGovBean.next}" render="editGrid,checkGroup,err,numberPer,canclButton"/>
                                <a4j:commandButton value="末张"  action="#{budgetCheckGovBean.last}" render="editGrid,checkGroup,err,numberPer,canclButton"/>
                                <a4j:commandButton id="canclButton" value="撤消" action="#{budgetCheckGovBean.canclCheck}" render="@form,checkGroup"
                                                   disabled="#{!budgetCheckGovBean.checkStatus or budgetCheckGovBean.detail.status != '3'}"/>
                                <h:commandButton value="返回列表" action="#{budgetCheckGovBean.goback}"/>
                            </rich:toolbarGroup>
                        </rich:toolbar>
                        <div style="width:780px;overflow:auto;">
                            <fieldset class="demo_fieldset">
                                <legend class="demo_legend">预算明细信息</legend>
                                <h:panelGrid id="editGrid" columns="4" width="100%" style="text-align:left;">
                                    <h:outputLabel value="编号："/>
                                    <h:outputText value="#{budgetCheckGovBean.detail.number}"/>

                                    <h:outputLabel value="项目：" rendered="#{budgetCheckGovBean.detail.project.finName != null}" />
                                    <h:outputText  value="#{budgetCheckGovBean.detail.project.finName}"
                                                   rendered="#{budgetCheckGovBean.detail.project.finName != null}"/>

                                    <h:outputLabel value="预算类别："/>
                                    <h:outputText  value="#{budgetCheckGovBean.detail.planWay}"
                                                   style="width:130px;">
                                    </h:outputText>
                                    <h:outputLabel value="品目："/>
                                    <h:outputText value="#{budgetCheckGovBean.detail.cate.name}"/>
                                    <h:outputLabel value="规格型号："/>
                                    <h:outputText value="#{budgetCheckGovBean.detail.model}"/>
                                    <h:outputLabel value="计量单位："/>
                                    <h:outputText value="#{budgetCheckGovBean.detail.cate.unit}" />
                                    <h:outputLabel value="采购数量："/>
                                    <h:outputText value="#{budgetCheckGovBean.detail.cate.count}"
                                                  style="text-align: right;">
                                        <f:convertNumber type="number" pattern="#,##0"/>
                                    </h:outputText>

                                    <h:outputLabel value="财政性资金："/>
                                    <h:outputText value="#{budgetCheckGovBean.detail.financial}"
                                                  style="text-align: right">
                                        <f:convertNumber type="number" pattern="#,##0.00"/>
                                    </h:outputText>
                                    <h:outputLabel value="其他资金："/>
                                    <h:outputText value="#{budgetCheckGovBean.detail.other}"
                                                  style="text-align: right">
                                        <f:convertNumber type="number" pattern="#,##0.00"/>
                                    </h:outputText>
                                    <h:outputLabel value="组织形式："/>
                                    <h:outputText value="集中采购" rendered="#{budgetCheckGovBean.detail.organizeForm == '0'}"/>
                                    <h:outputText value="部门集中采购" rendered="#{budgetCheckGovBean.detail.organizeForm == '1'}"/>
                                    <h:outputText value="分散采购" rendered="#{budgetCheckGovBean.detail.organizeForm == '2'}"/>

                                    <h:outputLabel value="委托集中采购机构："/>
                                    <h:outputText value="#{budgetCheckGovBean.detail.organ}"/>

                                    <h:outputLabel value="采购方式："/>
                                    <h:outputText value="公开招标" rendered="#{budgetCheckGovBean.detail.cateWay == '0'}"/>
                                    <h:outputText value="邀请招标" rendered="#{budgetCheckGovBean.detail.cateWay == '1'}"/>
                                    <h:outputText value="竞争性谈判" rendered="#{budgetCheckGovBean.detail.cateWay == '2'}"/>
                                    <h:outputText value="单一来源" rendered="#{budgetCheckGovBean.detail.cateWay == '3'}"/>
                                    <h:outputText value="询价" rendered="#{budgetCheckGovBean.detail.cateWay == '4'}"/>

                                    <h:outputLabel value="附信息:" rendered="#{budgetCheckGovBean.detail.cateData.selectName != null}"/>
                                    <h:outputText value="#{budgetCheckGovBean.detail.cateData.selectName}"
                                                  rendered="#{budgetCheckGovBean.detail.cateData.selectName != null}">
                                    </h:outputText>

                                </h:panelGrid>
                            </fieldset>
                            <fieldset class="demo_fieldset">
                                <legend class="demo_legend">预算审核</legend>
                                <h:panelGroup id="checkGroup">
                                    <rich:panel>
                                        <h:panelGrid id="check" columns="1" width="500px">
                                            <h:outputLabel value="是否同意：" style="font-weight:bolder"/>
                                            <h:selectOneRadio value="#{budgetCheckGovBean.currennode.isConfirm}"
                                                              style="margin-left:80px;" disabled="#{budgetCheckGovBean.checkStatus}">
                                                <f:selectItem itemValue="1" itemLabel="同意"/>
                                                <f:selectItem itemValue="2" itemLabel="不同意"/>
                                                <a4j:ajax event="click" execute="@this" render="content,checkGroup" listener="#{budgetCheckGovBean.contentListener}" />
                                            </h:selectOneRadio>
                                        </h:panelGrid>
                                    </rich:panel>
                                    <rich:panel id="content" >
                                        <h:outputLabel value="审批意见：" style="vertical-align:top;font-weight:bolder"/>
                                        <h:inputTextarea  cols="90" rows="6"
                                                          value="#{budgetCheckGovBean.currennode.content}"
                                                          disabled="#{budgetCheckGovBean.checkStatus}" />
                                        <br />
                                    </rich:panel>
                                    <rich:panel>
                                        <h:panelGrid id="check1" columns="2" width="100%">
                                            <h:panelGrid columns="2">
                                                <h:outputLabel value="审批人：" style="font-weight:bolder"/>
                                                <h:outputLabel  value="#{budgetCheckGovBean.currennode.checkerName}"/>
                                            </h:panelGrid>
                                            <h:panelGrid columns="2">
                                                <h:outputLabel value="审批日期：" style="font-weight:bolder"/>
                                                <h:outputLabel id="checkdate" value="#{budgetCheckGovBean.currennode.checkdate}">
                                                    <f:convertDateTime timeZone="GMT+8" pattern="yyyy-MM-dd HH:mm" dateStyle="medium"/>
                                                </h:outputLabel>
                                            </h:panelGrid>
                                        </h:panelGrid>
                                    </rich:panel>
                                    <a4j:commandButton value="审批" action="#{budgetCheckGovBean.check}" render="@form"
                                                       disabled="#{budgetCheckGovBean.checkStatus}"
                                                       onclick="this.disabled = 'true'"
                                                       style="margin-left:300px"/>
                                </h:panelGroup>
                            </fieldset>
                        </div>
                    </rich:panel>
                </h:form> 
            </ui:composition>
        </div>
    </body>
</html>
